package com.lw.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 用户表 表定义层。
 *
 * @author lw
 * @since 2025年05月06日 14:17:08
 */
public class TbUserTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 用户表
     */
    public static final TbUserTableDef TB_USER = new TbUserTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 编码
     */
    public final QueryColumn CODE = new QueryColumn(this, "code");

    /**
     * 用户名
     */
    public final QueryColumn NAME = new QueryColumn(this, "name");

    /**
     *  备注
     */
    public final QueryColumn NOTE = new QueryColumn(this, "note");

    /**
     * 电话
     */
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 角色id
     */
    public final QueryColumn ROLE_ID = new QueryColumn(this, "role_id");

    /**
     * 状态：success，info
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 地址
     */
    public final QueryColumn ADDRESS = new QueryColumn(this, "address");

    /**
     * 单位
     */
    public final QueryColumn COMPANY = new QueryColumn(this, "company");

    /**
     * 联系人
     */
    public final QueryColumn CONTACT = new QueryColumn(this, "contact");

    /**
     * 意图
     */
    public final QueryColumn PURPOSE = new QueryColumn(this, "purpose");

    /**
     * 行业
     */
    public final QueryColumn INDUSTRY = new QueryColumn(this, "industry");

    /**
     * 密码
     */
    public final QueryColumn PASSWORD = new QueryColumn(this, "password");

    /**
     * 登录名
     */
    public final QueryColumn LOGIN_NAME = new QueryColumn(this, "login_name");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 到期时间
     */
    public final QueryColumn EXPIRE_TIME = new QueryColumn(this, "expire_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 接口数量
     */
    public final QueryColumn INTERFACE_COUNT = new QueryColumn(this, "interface_count");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, NAME, LOGIN_NAME, PASSWORD, UPDATE_TIME, ROLE_ID, COMPANY, CODE, CONTACT, PHONE, INDUSTRY, ADDRESS, STATUS, INTERFACE_COUNT, PURPOSE, CREATE_TIME, EXPIRE_TIME, NOTE};

    public TbUserTableDef() {
        super("", "tb_user");
    }

    private TbUserTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TbUserTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TbUserTableDef("", "tb_user", alias));
    }

}
